function createAjaxObject()
{
    xmlhttp = false;
    xmlhttpObj = ["MSXML2.XmlHttp.5.0","MSXML2.XmlHttp.4.0","MSXML2.XmlHttp.3.0","MSXML2.XmlHttp","Microsoft.XmlHttp"];
    
    if(window.XMLHttpRequest)
    {
        xmlhttp = new XMLHttpRequest();
    }
    else if(window.ActiveXObject)
    {
        for(i=0;i<xmlhttpObj.length;i++)    
        {
	            xmlhttp = new ActiveXObject(xmlhttpObj[i]);
	            if(xmlhttp)
	            {
	                break;    
	            }
        }
    }
    else
    {
        alert("cannot create XMLHttpRequest");
    }
    return xmlhttp?xmlhttp:false;
}

var ajaxObject = createAjaxObject();
var ajax_callback_string = "";
function inputCheck(url, spanid) {
	ajaxObject.open("GET", url, true);
	ajaxObject.onreadystatechange = function () {
		callback(spanid);
	};
	ajaxObject.send(null);
	return ajax_callback_string;
}
function callback(spanid) {
	
	if (ajaxObject.readyState == 4 && ajaxObject.status == 200) {
		document.getElementById(spanid).innerHTML = ajaxObject.responseText;
		ajax_callback_string = ajaxObject.responseText;
	} 
}









